package com.rain.example.verifyPermissions.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class JWTConfig {
    public static String secret;
    public static String tokenHeader;
    public static String tokenPrefix;
    public static Long expiration;
    public static String antMatchers;

    @Value("${jwt.secret}")
    private void setSecret(String secret){
        JWTConfig.secret = secret;
    }
    @Value("${jwt.tokenHeader}")
    private void setTokenHeader(String tokenHeader){
        JWTConfig.tokenHeader = tokenHeader;
    }
    @Value("${jwt.tokenPrefix}")
    private void setTokenPrefix(String tokenPrefix){
        JWTConfig.tokenPrefix = tokenPrefix;
    }
    @Value("${jwt.expiration}")
    private void setExpiration(Long expiration){
        JWTConfig.expiration = expiration;
    }
    @Value("${jwt.antMatchers}")
    private void setAntMatchers(String antMatchers){
        JWTConfig.antMatchers = antMatchers;
    }
}
